public class Solution1 {
    
    public int uniquePaths(int m, int n) {
        int[][] meo = new int[m + 1][n + 1];
        return dfs(m, n, meo);
    }

    public int dfs(int i, int j, int[][] meo){
        if(meo[i][j] != 0) { return meo[i][j];}

        if(i == 0 || j == 0) { return 0;}
        if(i == 1 && j == 1) { return 1;}

        meo[i][j] = dfs(i - 1, j, meo) + dfs(i, j - 1, meo);
        return meo[i][j];
    }
}